-
Notifications
You must be signed in to change notification settings - Fork 829
Add Overrides API component and rename old overrides to overrides-configs #6975
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: Bogdan Stancu <[email protected]>
29f5299
to
1dbe402
Compare
Signed-off-by: Bogdan Stancu <[email protected]>
1dbe402
to
60d09fb
Compare
Signed-off-by: Bogdan Stancu <[email protected]>
Signed-off-by: Bogdan Stancu <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am liking it. I have do have a couple of suggestions
Signed-off-by: Bogdan Stancu <[email protected]>
90512a2
to
608f1ab
Compare
Signed-off-by: Bogdan Stancu <[email protected]>
Signed-off-by: Bogdan Stancu <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I gave it another pass. Thanks for your hard work!
@@ -411,6 +411,296 @@ query_scheduler: | |||
# CLI flag: -query-scheduler.grpc-client-config.connect-timeout | |||
[connect_timeout: <duration> | default = 5s] | |||
|
|||
overrides: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You added a new target "overrides", that's good. No need to add new flags. Use the flags available: https://cortexmetrics.io/docs/configuration/configuration-file/#runtime_configuration_storage_config
if c.Backend == bucket.Filesystem { | ||
return errors.New(ErrFilesystemBackendNotSupported) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Filesystem is supported by the runtime configuration overrides. The API should support it. Remove this.
) | ||
|
||
// Config holds configuration for the overrides module | ||
type Config struct { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove this config. Use
cortex/pkg/util/runtimeconfig/manager.go
Line 31 in 2c07f00
type Config struct { |
@@ -126,6 +127,7 @@ type Config struct { | |||
RuntimeConfig runtimeconfig.Config `yaml:"runtime_config"` | |||
MemberlistKV memberlist.KVConfig `yaml:"memberlist"` | |||
QueryScheduler scheduler.Config `yaml:"query_scheduler"` | |||
Overrides overrides.Config `yaml:"overrides"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overrides overrides.Config `yaml:"overrides"` |
@@ -175,6 +177,7 @@ func (c *Config) RegisterFlags(f *flag.FlagSet) { | |||
c.RuntimeConfig.RegisterFlags(f) | |||
c.MemberlistKV.RegisterFlags(f) | |||
c.QueryScheduler.RegisterFlags(f) | |||
c.Overrides.RegisterFlags(f) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
c.Overrides.RegisterFlags(f) |
@@ -66,6 +66,9 @@ For the sake of clarity, in this document we have grouped API endpoints by servi | |||
| [Delete Alertmanager configuration](#delete-alertmanager-configuration) | Alertmanager || `DELETE /api/v1/alerts` | | |||
| [Tenant delete request](#tenant-delete-request) | Purger || `POST /purger/delete_tenant` | | |||
| [Tenant delete status](#tenant-delete-status) | Purger || `GET /purger/delete_tenant_status` | | |||
| [Get user overrides](#get-user-overrides) | Overrides || `GET /api/v1/user-overrides` | | |||
| [Set user overrides](#set-user-overrides) | Overrides || `PUT /api/v1/user-overrides` | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| [Set user overrides](#set-user-overrides) | Overrides || `PUT /api/v1/user-overrides` | | |
| [Set user overrides](#set-user-overrides) | Overrides || `POST /api/v1/user-overrides` | |
type RuntimeConfigFile struct { | ||
Overrides map[string]map[string]interface{} `yaml:"overrides"` | ||
HardOverrides map[string]map[string]interface{} `yaml:"hard_overrides"` | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
type RuntimeConfigFile struct { | |
Overrides map[string]map[string]interface{} `yaml:"overrides"` | |
HardOverrides map[string]map[string]interface{} `yaml:"hard_overrides"` | |
} |
This overrides the other values saved in the runtime like ingester_limits
Use
cortex/pkg/cortex/runtime_config.go
Line 26 in 2c07f00
type RuntimeConfigValues struct { |
And make sure the API doesn't delete ingester_limits values and similar
var AllowedLimits = []string{ | ||
"max_global_series_per_user", | ||
"max_global_series_per_metric", | ||
"ingestion_rate", | ||
"ingestion_burst_size", | ||
"ruler_max_rules_per_rule_group", | ||
"ruler_max_rule_groups_per_tenant", | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
put this configuration in the runtime config
https://cortexmetrics.io/docs/configuration/configuration-file/#runtime_configuration_storage_config
} | ||
|
||
// RegisterFlags registers the overrides module flags | ||
func (c *Config) RegisterFlags(f *flag.FlagSet) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove this
} | ||
|
||
// Validate validates the configuration and returns an error if validation fails | ||
func (c *Config) Validate() error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove this
Also add the overrides API to https://github.com/cortexproject/cortex/blob/master/docs/configuration/v1-guarantees.md |
Adds initial draft for the User Overrides API, described in https://cortexmetrics.io/docs/proposals/overrides-api/
Checklist
CHANGELOG.md
updated - the order of entries should be[CHANGE]
,[FEATURE]
,[ENHANCEMENT]
,[BUGFIX]